package com.xzuf.core.ui;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

/**
 * 关于对话框
 * @author xzgf
 * @since 2008-7-12
 * @version 1.0
 */
public class About extends JDialog
{

    private static final long serialVersionUID = 0x2b30a1de04065294L;
    private JPanel jContentPane;
    private JLabel lblName;
    private JLabel lblVersion;
    private JLabel lblTime;
    private JLabel lblCopyRight;
    private JButton jButton;

    public About()
    {
        jContentPane = null;
        lblName = null;
        lblVersion = null;
        lblTime = null;
        lblCopyRight = null;
        jButton = null;
        initialize();
    }

    private void initialize()
    {
        setTitle("关于");
        setResizable(false);
        setSize(355, 258);
        setContentPane(getJContentPane());
        setVisible(false);
        lblName.setText("高峰");
        lblVersion.setText("1.0");
        lblTime.setText("2008-07-12");
        lblCopyRight.setText("gaofeng@foxmail.com");
    }

    private JPanel getJContentPane()
    {
        if(jContentPane == null)
        {
            lblCopyRight = new JLabel();
            lblTime = new JLabel();
            lblVersion = new JLabel();
            lblName = new JLabel();
            jContentPane = new JPanel();
            jContentPane.setLayout(null);
            lblName.setText("JLabel");
            lblName.setBounds(37, 23, 269, 22);
            lblVersion.setBounds(36, 53, 269, 19);
            lblVersion.setText("JLabel");
            lblTime.setBounds(36, 81, 271, 20);
            lblTime.setText("JLabel");
            lblCopyRight.setBounds(36, 113, 271, 20);
            lblCopyRight.setText("JLabel");
            jContentPane.setPreferredSize(new Dimension(355, 240));
            jContentPane.add(lblName, null);
            jContentPane.add(lblVersion, null);
            jContentPane.add(lblTime, null);
            jContentPane.add(lblCopyRight, null);
            jContentPane.add(getJButton(), null);
        }
        return jContentPane;
    }

    private JButton getJButton()
    {
        if(jButton == null)
        {
            jButton = new JButton();
            jButton.setBounds(150, 179, 69, 25);
            jButton.setText("确定");
            jButton.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e)
                {
                    setVisible(false);
                }

            });
        }
        return jButton;
    }
}
